﻿#include "define.h"

ModbusRegMap_s g_regMap[] =
{
    {MODBUS_REG_GET_SYSTEM,           0x0000,    0x001a - 0x0000 + 1},
    {MODBUS_REG_GET_MOTOR_CTRL_M,     0x0040,    0x004f - 0x0040 + 1},
    {MODBUS_REG_GET_MOTOR_CTRL_S,     0x0080,    0x008f - 0x0080 + 1},
    {MODBUS_REG_GET_APP,              0x00c0,    0x00e8 - 0x00c0 + 1},
    {MODBUS_REG_GET_MOTOR_DATA,       0x0100,    0x017f - 0x013b + 1},
    {MODBUS_REG_GET_ALOG_DATA,        0x0180,    0x01ad - 0x0180 + 1},
    {MODBUS_REG_GET_CMD,              0x0210,    0x0216 - 0x0210 + 1},
    {MODBUS_REG_GET_DNA,              0x026e,    0x02b9 - 0x026e + 1},
};

QString g_dhcp[] =
{
    "DHCP(自动获取)",
    "Static(手动设置)"
};

QString g_baudrate[] =
{
    "未获取",
    "2400 bps",
    "4800 bps",
    "9600 bps",
    "14400 bps",
    "19200 bps",
    "38400 bps",
    "56000 bps",
    "57600 bps",
    "115200 bps"
};

QString g_logLevel[] =
{
    "关闭日志输出",
    "错误输出",
    "警告输出",
    "信息输出",
    "调试输出"
};

QString g_upgradeState[] =
{
    "等待中",
    "升级中",
    "升级完成",
    "升级失败"
};

QMap<quint16, QString> g_finishState =
{
    {0, "未完成维护指令"},
    {1, "零点已校正"},
    {2, "零点、下限位完成"},
    {3, "零点、上下限位完成"}
};

QMap<quint16, QString> g_curMode =
{
    {0x00, "空模式"},
    {0x01, "位置模式"},
    {0x03, "速度模式"},
    {0x04, "力矩模式"},
    {0x06, "回零模式"},
    {0x08, "同步位置模式"},
    {0x09, "同步速度模式"},
    {0x0a, "同步力矩模式"},
    {0x0b, "力控模式"},
    {0x16, "模拟量控速度模式"},
    {0x17, "模拟量控力矩模式"},
    {0x1f, "脉冲控位置模式"},
    {0x2a, "PWM控速度"},
    {0x3c, "往复位置模式"},
    {0x3d, "参考信号"},
    {0x3e, "多段运行模式"}
};

QMap<quint16, QString> g_cmdMode =
{
    {0, "无模式"},
    {1, "SFCS+APS模式"},
    {2, "SFCS+CAL模式"},
    {3, "SFCS+CLEAN模式"},
    {4, "SFCS模式"},
    {5, "LOC模式"}
};

QMap<quint16, QString> g_cmdOrder =
{
    {0, "空闲"},
    {1, "定位回平姿态"},
    {2, "定位绝对姿态角度"},
    {3, "定位相对姿态角度"},
    {4, "定位推杆行程"},
    {5, "定位清洗姿态"},
    {6, "定位避光安置"},
    {7, "定位除雪姿态"},
    {8, "定位避雹姿态"},
    {9, "定位避雨姿态"},
    {10, "定位跟踪吸热器备用点"},
    {11, "定位吸热器目标点"},
    {12, "定位校准备用点"},
    {13, "定位校准点"},
    {14, "定位散焦点"},
    {21, "霍尔传感器寻零"},
    {22, "检查上限位开关"},
    {23, "检查下限位开关"},
    {31, "紧急自动散焦"},
    {32, "紧急手动散焦"},
    {33, "紧急自动回平"},
    {34, "紧急手动回平"},
    {35, "紧急安置"}
};

QMap<quint16, QString> g_cmdAttitude =
{
    {0, "空闲"},
    {1, "定位回平姿态DONE"},
    {2, "定位绝对姿态角度DONE"},
    {3, "定位相对姿态角度DONE"},
    {4, "定位推杆行程DONE"},
    {5, "定位清洗姿态DONE"},
    {6, "定位避光安置DONE"},
    {7, "定位除雪姿态DONE"},
    {8, "定位避雹姿态DONE"},
    {9, "定位避雨姿态DONE"},
    {10, "定位跟踪吸热器备用点DONE"},
    {11, "定位吸热器目标点DONE"},
    {12, "定位校准备用点DONE"},
    {13, "定位校准点DONE"},
    {14, "定位散焦点DONE"},
    {21, "霍尔传感器寻零DONE"},
    {22, "检查上限位开关DONE"},
    {23, "检查下限位开关DONE"},
    {31, "紧急自动散焦DONE"},
    {32, "紧急手动散焦DONE"},
    {33, "紧急自动回平DONE"},
    {34, "紧急手动回平DONE"},
    {35, "紧急安置DONE"},
    {51, "定位回平姿态ING"},
    {52, "定位绝对姿态角度ING"},
    {53, "定位相对姿态角度ING"},
    {54, "定位推杆行程ING"},
    {55, "定位清洗姿态ING"},
    {56, "定位避光安置ING"},
    {57, "定位除雪姿态ING"},
    {58, "定位避雹姿态ING"},
    {59, "定位避雨姿态ING"},
    {60, "定位跟踪吸热器备用点ING"},
    {61, "定位吸热器目标点ING"},
    {62, "定位校准备用点ING"},
    {63, "定位校准点ING"},
    {64, "定位散焦点ING"},
    {71, "霍尔传感器寻零ING"},
    {72, "检查上限位开关ING"},
    {73, "检查下限位开关ING"},
    {81, "紧急自动散焦ING"},
    {82, "紧急手动散焦ING"},
    {83, "紧急自动回平ING"},
    {84, "紧急手动回平ING"},
    {85, "紧急安置ING"},
};
